extends Node2D

class_name Food

signal eat_done
var full = false
@onready var anim = $AnimatedSprite2D
# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass

func _on_area_2d_body_entered(body):
	if full: 
		return
	if body is Human and body.name == 'Hero':
		reparent(body)
		body.food = self
		body.pb.start()
		await body.pb.done
		anim.play("full")
		full = true
		
